﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Entity;
using Utils;
using Library;
using DataContext;

namespace HighLowGameBLL
{
    public class CtrLogHiLoSession
    {
        public uspLogHiLoSessionStatisticsResult StatisticsLogHiLoSession(DateTime fromDate, DateTime toDate)
        {
            return DB.HighLowGameInstance.uspLogHiLoSessionStatistics(fromDate, toDate).FirstOrDefault();
        }

        public List<uspLogHiLoSessionSelectByResult> SelectHiLoSessionBy(DateTime fromDate, DateTime toDate,
            int accountId, int accountTypeId, string accountName, int sessionStatus, int betUnit, int finishStatus,
            ref long? totalAuBet, ref  long? totalAgBet, ref  long? totalAuCollect, ref  long? totalAgCollect, 
            int currentPage, int pageSize, ref int? totalRecord)
        {
            return DB.HighLowGameInstance.uspLogHiLoSessionSelectBy(-1, fromDate, toDate, accountId, accountTypeId, accountName,
                sessionStatus, betUnit, finishStatus,ref totalAuBet,ref totalAgBet,ref totalAuCollect,ref totalAgCollect, 
                currentPage, pageSize, ref totalRecord).ToList();
        }

        public List<uspLogHiLoSessionRoundStatisticsByResult> SelectHiLoSessionRoundStatistics(DateTime fromDate, DateTime toDate,
            int accountId, int accountTypeId, string accountName, int sessionStatus, int betUnit, int finishStatus)
        {
            return DB.HighLowGameInstance.uspLogHiLoSessionRoundStatisticsBy(-1, fromDate, toDate, accountId, accountTypeId, accountName,
                sessionStatus, betUnit, finishStatus).ToList();
        }
    }
}
